package com.findme.fecedetection.net


import com.findme.fecedetection.bean.*
import com.google.gson.JsonObject
import io.reactivex.Observable
import okhttp3.MultipartBody
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.http.*

/**
 * Created by liaoxiang on 16/6/20.
 * http://47.96.15.126:8088/petHome/api/pet/info/single?petId=1
 * http://47.96.15.126:8088/petHome/api/pet/info/single?petId=3
 */
interface ApiService {
    //    @POST("app.server")
    //    Observable<ResultData<ArrayList<CarType>>> getTypeList(@Query("key") String key);
    @GET("petHome/api/pet/info/page")
    fun getPage(@Query("color") color: String, @Query("category") category: String, @Query("type") type: String, @Query("size") size: String, @Query("location") location: String, @Query("userCode") userCode: String, @Query("pageNo") pageNo: String
    ): Observable<ResultData<ResultList<ArrayList<PetListBean>>>>

    @GET("petHome/api/pet/info/single")
    fun singleDetails(@Query("petId") petId: Int): Observable<ResultData<PetDetailsBean>>

    @GET("petHome/api/sms/verify/code")
    fun getCode(@Query("mobile") mobile: String): Observable<ResultData<Any?>>

    @GET("petHome/api/map/ip/address")
    fun address(): Observable<ResultData<JsonObject>>


    @Multipart
    @POST("petHome/api/pet/img/upload")
    fun uploadImage(@Part partList: List<MultipartBody.Part>): Observable<ResponseBody>

    @POST("petHome/api/user/regist")
    fun regist(@Body json: RequestBody): Observable<ResultData<Any>>

    @POST("petHome/api/user/login")
    fun login(@Body json: RequestBody): Observable<ResultData<Any>>
    @GET("petHome/api/dictionary/info/list")
    fun list(): Observable<ResultData<List<Dictionaries>>>

}
